package com.cloud.mall.cms.service.impl;

import com.cloud.mall.base.BaseResponse;
import com.cloud.mall.cms.mapper.CmsPrefrenceAreaMapper;
import com.cloud.mall.cms.model.CmsPrefrenceArea;
import com.cloud.mall.cms.model.CmsPrefrenceAreaExample;
import com.cloud.mall.cms.out.CmsPrefrenceAreaOut;
import com.cloud.mall.cms.service.CmsPrefrenceAreaService;
import com.cloud.mall.core.bean.MallBeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
public class CmsPrefrenceAreaServiceImpl implements CmsPrefrenceAreaService {
    @Autowired
    private CmsPrefrenceAreaMapper prefrenceAreaMapper;


    @Override
    public BaseResponse<List<CmsPrefrenceAreaOut>> list() {
        List<CmsPrefrenceArea> cmsPrefrenceAreas=prefrenceAreaMapper.selectByExample(new CmsPrefrenceAreaExample());
        return BaseResponse.setResultSuccess(MallBeanUtils.copyDoToDto(cmsPrefrenceAreas,CmsPrefrenceAreaOut.class));
    }

}
